/**
 * 
 */
package com.evon.yardmanagement.ui.action;


import com.evon.yardmanagement.model.KeyBox;
import com.evon.yardmanagement.service.KeyBoxManagementService;
import com.evon.yardmanagement.transformer.KeyBoxTransformer;
import com.evon.yardmanagement.ui.dto.KeyBoxDTO;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author Sandeep
 *
 */
public class AddKeyBoxAction extends ActionSupport {
	
    private Integer keyBoxId;
	
	private Integer keyBoxNumber;
	
	private String keyBoxName;
	
	private int keyBoxOccupied;
	
public String execute() throws Exception {
	
	
		
		KeyBoxDTO keyBoxDto = new KeyBoxDTO();
		//KeyBox keyBox = KeyBoxTransformer.transformKeyBox(keyBoxDto);
		KeyBox keyBox = new KeyBox(); 
		keyBox.setId(getKeyBoxId());
		keyBox.setName(getKeyBoxName());
		keyBox.setBoxNumber(getKeyBoxNumber());
		keyBox.setOccupied(getKeyBoxOccupied());
		
		
		KeyBoxManagementService service = new KeyBoxManagementService();
		boolean isKeyBinAdded = service.addKeyBox(keyBox);
		
		return SUCCESS;
	}

public Integer getKeyBoxId() {
	return keyBoxId;
}

public void setKeyBoxId(Integer keyBoxId) {
	this.keyBoxId = keyBoxId;
}

public Integer getKeyBoxNumber() {
	return keyBoxNumber;
}

public void setKeyBoxNumber(Integer keyBoxNumber) {
	this.keyBoxNumber = keyBoxNumber;
}

public String getKeyBoxName() {
	return keyBoxName;
}

public void setKeyBoxName(String keyBoxName) {
	this.keyBoxName = keyBoxName;
}

public int getKeyBoxOccupied() {
	return keyBoxOccupied;
}

public void setKeyBoxOccupied(int keyBoxOccupied) {
	this.keyBoxOccupied = keyBoxOccupied;
}

}
